package lumis.portal.serialization.operation;

/**
 * Represents a config deletion operation
 *
 * @version $Revision: 4942 $ $Date: 2006-11-03 09:10:15 -0300 (Fri, 03 Nov 2006) $
 * @since 4.0.7
 */
public class ConfigDeletion extends ConfigOperation
{
	private final String configId;
	private final IConfigDeleter configDeleter;
	public ConfigDeletion(final String configId, final IConfigDeleter configDeleter)
	{
		super();
		this.configId = configId;
		this.configDeleter = configDeleter;
	}
	public IConfigDeleter getConfigDeleter()
	{
		return configDeleter;
	}
	public String getConfigId()
	{
		return configId;
	}
	@Override
	public int hashCode()
	{
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((configDeleter == null) ? 0 : configDeleter.hashCode());
		result = PRIME * result + ((configId == null) ? 0 : configId.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final ConfigDeletion other = (ConfigDeletion) obj;
		if (configDeleter == null)
		{
			if (other.configDeleter != null)
				return false;
		}
		else if (!configDeleter.equals(other.configDeleter))
			return false;
		if (configId == null)
		{
			if (other.configId != null)
				return false;
		}
		else if (!configId.equals(other.configId))
			return false;
		return true;
	}
	
	
}
